from greenlet import greenlet

def produce(number):
    for i in range(0, 8):
        print("producer: ", number)
        number = consumer_gr.switch(number)


def consume(number):
    for i in range(0, 8):
        print("    consumer: ", number)
        number = producer_gr.switch(chr(ord(number) + 1))


producer_gr = greenlet(produce)
consumer_gr = greenlet(consume)

producer_gr.switch('a')
